package com.chy.blog_web.core.adapter;

import com.chy.blog_web.core.interceptor.SpaceUserLoginInterceptor;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * 空间登录拦截器适配器
 */
@Configuration
public class SpaceUserLoginAdapter implements WebMvcConfigurer {

    @Override
    public void addInterceptors(InterceptorRegistry registry) {

        //添加对用户是否登录的拦截器，并添加过滤项、排除项
        registry.addInterceptor(new SpaceUserLoginInterceptor()).addPathPatterns("/blogSpace/**");
    }

}
